#include <iostream>

int main (int argc, char *argv[]){
    int n = -1;
    std::cin>>n;
    int A[n],A_as[n],C[10]={0};
    for (int i=0; i<n; i++){
        double x;
        std::cin>>x;
        x=10*x;
        int p =(int) x;
        A[i]=p;
        C[p]++;
    }
    for(int i=1;i<10;i++)
    C[i]+=C[i-1];
    for(int i=0;i<n;i++){
    std::cout<<A[i]<<", ";
    A_as[C[A[i]]-1]=A[i];
    C[A[i]]--;}
    std::cout<<std::endl<<"After Sort"<<std::endl;
    for(int i=0;i<n;i++)
    std::cout<<A_as[i]<<", ";
    std::cout<<std::endl;
    return 0;
}